import { Stack, dec2bin } from "./stack.js";
const stack = new Stack();
// console.log(stack);

// 进栈
stack.push('6')
stack.push('5')
stack.push('4')
stack.push('3')
stack.push('2')
stack.push('1') // 后进先出

console.log(stack.items);
console.log(stack.pop()); // 出栈
console.log(stack.items);
console.log(stack.peek()); // 栈顶元素
console.log(stack.isEmpty()); // 栈中是否为空
console.log(stack.size()); // 栈中元素个数

// 十进制转二进制
// console.log(dec2bin(10));
// console.log(dec2bin(100));
// console.log(dec2bin(1000));

